$(function(){
	$(".vc-pic").click(function(){
		//刷新验证码
		var _url = "ImageServlet?time="+new Date().getTime();
		$(".vc-pic").attr('src',_url);
	});
});		

//用户登陆
function loginPlat(){
	if ($('#loginForm').form('validate')){
		var data = $('#loginForm').serialize();
		$.ajax({
			url: '<c:url value="/user/login.do"/>',
			type: 'POST',
			data: data,
			beforeSend: function(XmlHttpRequest, textStatus, errorThrown) {
				$.messager.progress({
					title:'提示',
					msg:'正在登陆，请稍待...'
				});
			},
			success: function(result) {
				$.messager.progress('close');
				if(result.data == 'success'){
					//页面跳转
					window.location.href = '<c:url value="/user/main.do"/>';
				}
				else{
					$.messager.alert('错误', result.data, 'error');
				}
			}
		});
	}
}